﻿@model IList<pbvs.Models.ContentPage>
<style type="text/css">
    #menu { margin: 0; white-space: no-wrap; }
    #menu ul { padding: 0; margin: 0 auto; background-color: #AEB831;}
    #menu li { list-style: none; border-right: 1px solid black; white-space: no-wrap; width: 12em; margin: 0 auto}
    #menu a { display: block; padding: 3px; text-decoration: none; }
    #menu li ul { display: none; position: absolute; }
    #menu li:hover > ul { display: block; z-index: 999; }
    .topmenu { float: left; list-style-type: none; }
    .menu { min-width: 200px; }
    
</style>

<div id="menu">
    <ul class="menu">
        @foreach (pbvs.Models.ContentPage page in Model)
        {
            <li class="topmenu">
                @Html.ActionLink(page.MenuTitle, "ViewContent", "Content", new { page.PageName }, null)
                @if (page.Children.Any())
                {
                    <ul>
                        @foreach (pbvs.Models.ContentPage child in page.Children)
                        {
                            if (!string.IsNullOrEmpty(child.MenuTitle)) {
                            <li>
                                @Html.ActionLink(child.MenuTitle, "ViewContent", "Content", new { child.PageName }, null)
                            </li>
                            }
                        }
                    </ul>
                }
            </li>
        }
        <li class="topmenu">
            @Html.ActionLink("Request Valuation", "Index", "Valuation")
        </li>
    </ul>
</div>